<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.15"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>QuantumLibrary: Bloomberg::quantum::Buffer&lt; T, ALLOCATOR &gt; Class Template Reference</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../resize.js"></script>
<script type="text/javascript" src="../../navtreedata.js"></script>
<script type="text/javascript" src="../../navtree.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  $(document).ready(initResizable);
/* @license-end */</script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">QuantumLibrary
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.15 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="../../menudata.js"></script>
<script type="text/javascript" src="../../menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('../../',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('d1/d87/classBloomberg_1_1quantum_1_1Buffer.html','../../');});
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="../../d2/d84/classBloomberg_1_1quantum_1_1Buffer-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">Bloomberg::quantum::Buffer&lt; T, ALLOCATOR &gt; Class Template Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Container which allows buffered access to a series of values. Values are pushed-in (written) by a producer(s) and pulled-out (read) by a consumer(s).  
 <a href="../../d1/d87/classBloomberg_1_1quantum_1_1Buffer.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="../../d3/ded/quantum__buffer_8h_source.html">quantum_buffer.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:a7ad3ecd3e9add3eee5a9227f017e7fe4"><td class="memItemLeft" align="right" valign="top">using&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d1/d87/classBloomberg_1_1quantum_1_1Buffer.html#a7ad3ecd3e9add3eee5a9227f017e7fe4">ValueType</a> = T</td></tr>
<tr class="memdesc:a7ad3ecd3e9add3eee5a9227f017e7fe4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Type definition for the contained value.  <a href="#a7ad3ecd3e9add3eee5a9227f017e7fe4">More...</a><br /></td></tr>
<tr class="separator:a7ad3ecd3e9add3eee5a9227f017e7fe4"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a3a03390bf5f8259c46250369efeb647b"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d1/d87/classBloomberg_1_1quantum_1_1Buffer.html#a3a03390bf5f8259c46250369efeb647b">Buffer</a> (const ALLOCATOR &amp;alloc=ALLOCATOR())</td></tr>
<tr class="memdesc:a3a03390bf5f8259c46250369efeb647b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructor.  <a href="#a3a03390bf5f8259c46250369efeb647b">More...</a><br /></td></tr>
<tr class="separator:a3a03390bf5f8259c46250369efeb647b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0f7ff17c89f6dcfc4651f31b6e466b16"><td class="memTemplParams" colspan="2">template&lt;class V  = T&gt; </td></tr>
<tr class="memitem:a0f7ff17c89f6dcfc4651f31b6e466b16"><td class="memTemplItemLeft" align="right" valign="top"><a class="el" href="../../dc/d48/namespaceBloomberg_1_1quantum.html#a9322decc3c78f19a6262e572bd276b5f">BufferStatus</a>&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../d1/d87/classBloomberg_1_1quantum_1_1Buffer.html#a0f7ff17c89f6dcfc4651f31b6e466b16">push</a> (V &amp;&amp;value)</td></tr>
<tr class="memdesc:a0f7ff17c89f6dcfc4651f31b6e466b16"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pushes a value at the end of the buffer. This increases the size of the buffer by one.  <a href="#a0f7ff17c89f6dcfc4651f31b6e466b16">More...</a><br /></td></tr>
<tr class="separator:a0f7ff17c89f6dcfc4651f31b6e466b16"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afa86fb6ab65316f884e2392050bf2aed"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../dc/d48/namespaceBloomberg_1_1quantum.html#a9322decc3c78f19a6262e572bd276b5f">BufferStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d1/d87/classBloomberg_1_1quantum_1_1Buffer.html#afa86fb6ab65316f884e2392050bf2aed">pull</a> (T &amp;value)</td></tr>
<tr class="memdesc:afa86fb6ab65316f884e2392050bf2aed"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pulls the next value from the buffer. This decreases the size of the buffer by one.  <a href="#afa86fb6ab65316f884e2392050bf2aed">More...</a><br /></td></tr>
<tr class="separator:afa86fb6ab65316f884e2392050bf2aed"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1449c6d0ca59c621fb04f0e6cef00e44"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d1/d87/classBloomberg_1_1quantum_1_1Buffer.html#a1449c6d0ca59c621fb04f0e6cef00e44">close</a> ()</td></tr>
<tr class="memdesc:a1449c6d0ca59c621fb04f0e6cef00e44"><td class="mdescLeft">&#160;</td><td class="mdescRight">Close the buffer. Once this method is called, push operations are no longer permitted. Pull operations are permitted until the buffer empties.  <a href="#a1449c6d0ca59c621fb04f0e6cef00e44">More...</a><br /></td></tr>
<tr class="separator:a1449c6d0ca59c621fb04f0e6cef00e44"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0d7a77984b777fcd555583d4eb4d3b6f"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d1/d87/classBloomberg_1_1quantum_1_1Buffer.html#a0d7a77984b777fcd555583d4eb4d3b6f">isClosed</a> () const</td></tr>
<tr class="memdesc:a0d7a77984b777fcd555583d4eb4d3b6f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Indicates if the buffer is closed.  <a href="#a0d7a77984b777fcd555583d4eb4d3b6f">More...</a><br /></td></tr>
<tr class="separator:a0d7a77984b777fcd555583d4eb4d3b6f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af3ea4c4ca2b82d56bd9cbb69c3221596"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d1/d87/classBloomberg_1_1quantum_1_1Buffer.html#af3ea4c4ca2b82d56bd9cbb69c3221596">size</a> () const</td></tr>
<tr class="memdesc:af3ea4c4ca2b82d56bd9cbb69c3221596"><td class="mdescLeft">&#160;</td><td class="mdescRight">Indicates the number of values stored in the buffer.  <a href="#af3ea4c4ca2b82d56bd9cbb69c3221596">More...</a><br /></td></tr>
<tr class="separator:af3ea4c4ca2b82d56bd9cbb69c3221596"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad84dbc76f0914e603c7b91d6d56a6aa9"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d1/d87/classBloomberg_1_1quantum_1_1Buffer.html#ad84dbc76f0914e603c7b91d6d56a6aa9">empty</a> () const</td></tr>
<tr class="memdesc:ad84dbc76f0914e603c7b91d6d56a6aa9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Helper function equivalent to <a class="el" href="../../d1/d87/classBloomberg_1_1quantum_1_1Buffer.html#af3ea4c4ca2b82d56bd9cbb69c3221596" title="Indicates the number of values stored in the buffer.">size()</a> == 0;.  <a href="#ad84dbc76f0914e603c7b91d6d56a6aa9">More...</a><br /></td></tr>
<tr class="separator:ad84dbc76f0914e603c7b91d6d56a6aa9"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><h3>template&lt;class T, class ALLOCATOR&gt;<br />
class Bloomberg::quantum::Buffer&lt; T, ALLOCATOR &gt;</h3>

<p>Container which allows buffered access to a series of values. Values are pushed-in (written) by a producer(s) and pulled-out (read) by a consumer(s). </p>
<dl class="tparams"><dt>Template Parameters</dt><dd>
  <table class="tparams">
    <tr><td class="paramname">T</td><td>Type of the contained value. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section warning"><dt>Warning</dt><dd>This class is not thread safe. </dd></dl>
</div><h2 class="groupheader">Member Typedef Documentation</h2>
<a id="a7ad3ecd3e9add3eee5a9227f017e7fe4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7ad3ecd3e9add3eee5a9227f017e7fe4">&#9670;&nbsp;</a></span>ValueType</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class T, class ALLOCATOR&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">using <a class="el" href="../../d1/d87/classBloomberg_1_1quantum_1_1Buffer.html">Bloomberg::quantum::Buffer</a>&lt; T, ALLOCATOR &gt;::<a class="el" href="../../d1/d87/classBloomberg_1_1quantum_1_1Buffer.html#a7ad3ecd3e9add3eee5a9227f017e7fe4">ValueType</a> =  T</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Type definition for the contained value. </p>

</div>
</div>
<h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a3a03390bf5f8259c46250369efeb647b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3a03390bf5f8259c46250369efeb647b">&#9670;&nbsp;</a></span>Buffer()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class T , class ALLOCATOR&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../d1/d87/classBloomberg_1_1quantum_1_1Buffer.html">Bloomberg::quantum::Buffer</a>&lt; T, ALLOCATOR &gt;::<a class="el" href="../../d1/d87/classBloomberg_1_1quantum_1_1Buffer.html">Buffer</a> </td>
          <td>(</td>
          <td class="paramtype">const ALLOCATOR &amp;&#160;</td>
          <td class="paramname"><em>alloc</em> = <code>ALLOCATOR()</code></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Constructor. </p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a1449c6d0ca59c621fb04f0e6cef00e44"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1449c6d0ca59c621fb04f0e6cef00e44">&#9670;&nbsp;</a></span>close()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class T , class ALLOCATOR &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="../../d1/d87/classBloomberg_1_1quantum_1_1Buffer.html">Bloomberg::quantum::Buffer</a>&lt; T, ALLOCATOR &gt;::close </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Close the buffer. Once this method is called, push operations are no longer permitted. Pull operations are permitted until the buffer empties. </p>

</div>
</div>
<a id="ad84dbc76f0914e603c7b91d6d56a6aa9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad84dbc76f0914e603c7b91d6d56a6aa9">&#9670;&nbsp;</a></span>empty()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class T , class ALLOCATOR &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="../../d1/d87/classBloomberg_1_1quantum_1_1Buffer.html">Bloomberg::quantum::Buffer</a>&lt; T, ALLOCATOR &gt;::empty </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Helper function equivalent to <a class="el" href="../../d1/d87/classBloomberg_1_1quantum_1_1Buffer.html#af3ea4c4ca2b82d56bd9cbb69c3221596" title="Indicates the number of values stored in the buffer.">size()</a> == 0;. </p>
<dl class="section return"><dt>Returns</dt><dd>True if empty, false otherwise. </dd></dl>

</div>
</div>
<a id="a0d7a77984b777fcd555583d4eb4d3b6f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0d7a77984b777fcd555583d4eb4d3b6f">&#9670;&nbsp;</a></span>isClosed()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class T , class ALLOCATOR &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="../../d1/d87/classBloomberg_1_1quantum_1_1Buffer.html">Bloomberg::quantum::Buffer</a>&lt; T, ALLOCATOR &gt;::isClosed </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Indicates if the buffer is closed. </p>

</div>
</div>
<a id="afa86fb6ab65316f884e2392050bf2aed"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afa86fb6ab65316f884e2392050bf2aed">&#9670;&nbsp;</a></span>pull()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class T, class ALLOCATOR &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../dc/d48/namespaceBloomberg_1_1quantum.html#a9322decc3c78f19a6262e572bd276b5f">BufferStatus</a> <a class="el" href="../../d1/d87/classBloomberg_1_1quantum_1_1Buffer.html">Bloomberg::quantum::Buffer</a>&lt; T, ALLOCATOR &gt;::pull </td>
          <td>(</td>
          <td class="paramtype">T &amp;&#160;</td>
          <td class="paramname"><em>value</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Pulls the next value from the buffer. This decreases the size of the buffer by one. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">value</td><td>Reference to the variable which will contain the next valid value if return value is 'DataReceived'. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Result of the operation. See BufferStatus above for more details. </dd></dl>

</div>
</div>
<a id="a0f7ff17c89f6dcfc4651f31b6e466b16"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0f7ff17c89f6dcfc4651f31b6e466b16">&#9670;&nbsp;</a></span>push()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class T , class ALLOCATOR &gt; </div>
<div class="memtemplate">
template&lt;class V &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../dc/d48/namespaceBloomberg_1_1quantum.html#a9322decc3c78f19a6262e572bd276b5f">BufferStatus</a> <a class="el" href="../../d1/d87/classBloomberg_1_1quantum_1_1Buffer.html">Bloomberg::quantum::Buffer</a>&lt; T, ALLOCATOR &gt;::push </td>
          <td>(</td>
          <td class="paramtype">V &amp;&amp;&#160;</td>
          <td class="paramname"><em>value</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Pushes a value at the end of the buffer. This increases the size of the buffer by one. </p>
<dl class="tparams"><dt>Template Parameters</dt><dd>
  <table class="tparams">
    <tr><td class="paramname">V</td><td>Type of the contained value. Must be inferred and always equal to T. </td></tr>
  </table>
  </dd>
</dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">value</td><td>Value pushed into the buffer </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Result of the operation. See BufferStatus above for more details. </dd></dl>

</div>
</div>
<a id="af3ea4c4ca2b82d56bd9cbb69c3221596"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af3ea4c4ca2b82d56bd9cbb69c3221596">&#9670;&nbsp;</a></span>size()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class T , class ALLOCATOR &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">size_t <a class="el" href="../../d1/d87/classBloomberg_1_1quantum_1_1Buffer.html">Bloomberg::quantum::Buffer</a>&lt; T, ALLOCATOR &gt;::size </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Indicates the number of values stored in the buffer. </p>
<dl class="section return"><dt>Returns</dt><dd>Number of values in the buffer. </dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="../../d6/db9/namespaceBloomberg.html">Bloomberg</a></li><li class="navelem"><a class="el" href="../../dc/d48/namespaceBloomberg_1_1quantum.html">quantum</a></li><li class="navelem"><a class="el" href="../../d1/d87/classBloomberg_1_1quantum_1_1Buffer.html">Buffer</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="../../doxygen.png" alt="doxygen"/></a> 1.8.15 </li>
  </ul>
</div>
</body>
</html>
